<template>
  <el-card>
    <template #header>订单编辑</template>

    <div>根据id获取对应的数据，回写到表单 --- {{ $route.params }}</div>

    <p>{{ order }}</p>
  </el-card>
</template>

<script>
import { orderDetail } from '@/api/orders.js'

export default {
  data() {
    return {
      order: {}
    }
  },
  created() {
    this.getOrderDetail()
  },
  methods: {
    async getOrderDetail() {
      const { data } = await orderDetail({
        id: this.$route.params.id
      })
      console.log(data)
      this.order = data
    }
  }
}
</script>

<style lang="less" scoped></style>
